package com.brite.android.game.achievement.model.data.connection;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class GetConnection extends SQLiteOpenHelper{
	private static final String TBL_RANKING = "" +
			"CREATE TABLE tblRankings(id integer not null primary key autoincrement," +
										"userName nvarchar(100)," +
										"score INTEGER ," +
										"numberKill INTEGER );"; 
	
	public GetConnection(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
		
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(TBL_RANKING);	
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS tblRankings");
		onCreate(db);		
	}

}
